package org.nlp2rdf.navigator.server.tiger;

import java.util.HashMap;
import java.util.Map;

import com.hp.hpl.jena.ontology.Individual;
import com.hp.hpl.jena.ontology.OntClass;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.ModelFactory;

public class OntologyLabels {

	static String ont = "http://nachhalt.sfb632.uni-potsdam.de/owl/stts.owl";
	
	public static void main(String[] args) {
		System.out.println(getLabels());
	}
	public static Map<String,String> getLabels(){
		OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel());;
		m.read(ont);
		Map<String,String> map = new HashMap<String, String>();
		for(OntClass c : m.listClasses().toList()){
			map.put(c.getURI(),c.getComment(null));
//			System.out.println(c.getLabel(null));
		}
		for(Individual i : m.listIndividuals().toList()){
			OntClass cl = i.getOntClass(true);
			
			map.put(Config.prefix+i.getLocalName(),cl.getComment(null));
		}
		
		map.put(Config.prefix+"Sentence", "A sentence.");
		map.put(Config.prefix+"hasToken", "A token of a sentence.");
		map.put(Config.prefix+"previousToken", "The prvious token relative to another token in the sentence.");
		map.put(Config.prefix+"nextToken", "The next token relative to another token in the sentence. ");
		map.put(Config.prefix+"hasLemma", "The lemma of this token. ");
		
		return map;
		
	}
}
